package bitWork;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-12-09
 * Time: 14:39
 */
public class Work4 {
    public static void main(String[] args) {
        //只出现一次的数字
        int[] num = {4,1,2,1,2};
        int x = num[0];
        for (int i = 1; i < num.length; i++) {
            x ^= num[i];
        }
        System.out.println("只出现一次的数字：" + x);
    }
}
